package com.loan.market.ui

import android.content.Intent
import android.os.Bundle
import com.loan.market.R
import com.loan.market.base.BaseBindingActivity
import com.loan.market.databinding.ActivityTermsBinding
import com.loan.market.util.getConfig

class TermsActivity : BaseBindingActivity<ActivityTermsBinding>() {

    override fun getViewBinding(): ActivityTermsBinding {
        return ActivityTermsBinding.inflate(layoutInflater)
    }

    override fun initUi(savedInstanceState: Bundle?) {
    }

    override fun initEvent() {
        binding.tvTerm.setOnClickListener {
            getConfig {
                val intent = Intent(this, WebActivity::class.java)
                intent.putExtra("url", it.protocolUrls?.useTermsUrl)
                intent.putExtra("title", getString(R.string.terms_of_use))
                startActivity(intent)
            }
        }
        binding.tvPrivacy.setOnClickListener {
            getConfig {
                val intent = Intent(this, WebActivity::class.java)
                intent.putExtra("url", it.protocolUrls?.privicyPolicyUrl)
                intent.putExtra("title", getString(R.string.privacy_policy))
                startActivity(intent)
            }
        }
    }

    override fun initData() {
    }
}